import React from 'react'

import {NavLink} from 'react-router-dom'
import top from './top.module.css'
import {withRouter} from 'react-router-dom'

 class Top extends React.Component{
    change=(e)=>{
        for(let i=0;i<3;i++){
            e.target.parentNode.children[i].style.color='#000'
        }
        e.target.style.color='cornflowerblue'
    }
    render(){
        return (
            // <BrowserRouter>
            <div className={top.box}>
                <nav>
                    <NavLink to='/home' onClick={this.change}>首页</NavLink>
                    <NavLink to='/column' onClick={this.change}>收藏</NavLink>
                    <NavLink to='/follow' onClick={this.change}>关注</NavLink>
                </nav>
            </div>
        )
    }
}

export default withRouter(Top)